package hehe.worker.base;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

/**
 * 任务接口
 *<B>说明：</B>
 *<pre>
 * 略
 *</pre>
 *<B>示例：</B>
 *<pre>
 *  略
 *</pre>
 *<B>日志：</B>
 *<pre>
 *  略
 *</pre>
 *<B>注意事项：</B>
 *<pre>
 *  略
 *</pre>
 */
public class Task implements Runnable
{
    protected FutureTask<Object> callable;

    public Task(Callable callable)
    {
        this.callable = new FutureTask<>(callable);
    }

    public Task(Runnable runnable)
    {
        this.callable = new FutureTask<>(runnable,null);
    }

    public void run()
    {
        this.callable.run();
    }
}
